@extends('admin.page')
@section('body')
    <style type="text/css">
        .order-detail {
            margin-top: -4px;
        }

        .order-detail .layui-tab-title {
            height: auto;
        }

        .order-detail .layui-tab-title li {
            color: #333333;
            height: 22px;
            line-height: 22px;
            margin-right: 4px;
            background: #f0f0f0;
            font-size: 12px;
            margin-top: 6px;
        }

        .order-detail .layui-tab-title li:after {
            position: absolute;
            left: 0;
            top: 0;
            content: '';
            width: 100%;
            height: 23px;
            border-width: 1px;
            border-style: solid;
            border-color: #e3e3e3;
            border-radius: 4px 4px 0 0;
            box-sizing: border-box;
            pointer-events: none;
            border-bottom-color: transparent;
        }

        .order-detail .layui-tab-title li.layui-this {
            font-weight: bold;
            height: 28px;
            line-height: 28px;
            font-size: 16px;
            background: #ffffff;
            margin-top: 0;
        }

        .order-detail .layui-tab-title li.layui-this:after {
            height: 29px;
            border-color: #e3e3e3;
            border-radius: 4px 4px 0 0;
            border-bottom-color: #ffffff;
        }

        .order-detail .detail-title {
            font-size: 14px;
            color: #000;
            margin-bottom: 8px;
        }

        .order-detail .detail-item {
            margin-bottom: 14px;
        }

        .order-detail .detail-txt {
            font-size: 14px;
            color: #595959;
            line-height: 26px;
        }

        .detail_subtotal {
            float: right;
        }

        .detail_subtotal span {
            color: #e63126;
        }

        .order-detail .red {
            color: #e63126;
        }
    </style>
    <div class="layui-tab order-detail" style="padding: 20px;">
        <div class="layui-tab-item layui-show">

            <div class="detail-item">
                <div class="detail-title">基础信息</div>
                <div class="detail-content">
                    <div class="layui-row">
                        <div class="layui-col-md4 detail-txt">
                            <span class="detail-name">token：</span>
                            <span class="detail-value">{{$info['session_id']}}</span>
                        </div>
                    </div>
                    @if($info['user'])
                        <div class="layui-row">
                            <div class="layui-col-md4 detail-txt">
                                <span class="detail-name">用户ID：</span>
                                <span class="detail-value">{{$info['user']->id}}</span>
                            </div>
                            <div class="layui-col-md8 detail-txt">
                                <span class="detail-name">用户名称：</span>
                                <span class="detail-value">{{$info['user']->name}}</span>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md4 detail-txt">
                                <span class="detail-name">用户名：</span>
                                <span class="detail-value">{{$info['user']->username}}</span>
                            </div>
                            <div class="layui-col-md8 detail-txt">
                                <span class="detail-name">手机号：</span>
                                <span class="detail-value">{{$info['user']->mobile}}</span>
                            </div>
                        </div>
                    @endif
                </div>
            </div>
            <div class="detail-item">
                <div class="detail-title">操作记录</div>
                <div class="detail-content">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>操作时间</th>
                            <th>医院</th>
                            <th>IP</th>
                            <th>请求方式</th>
                            <th>请求地址</th>
                            <th>参数</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($info['logs'] as $k=>$log)
                            <tr>
                                <td>{{$k+1}}</td>
                                <td>{{$log['time']}}</td>
                                <td>{{$log['hospital_name']}}</td>
                                <td>{{$log['ip']}}</td>
                                <td>{{$log['method']}}</td>
                                <td>{{$log['url']}}</td>
                                <td>
                                    <a href="javascript:;" class="table-link"
                                       onclick="showParams({{$log['id']}})">参数</a>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
@stop

@push('script')
    <script type="application/javascript">
        function showParams(id) {
            parent.SystemUtil.openUrl('参数', "{{admin_url($baseRoute.'params')}}/" + id, ['650px', '385px']);
        }
    </script>
@endpush